<%-- 
    Document   : admin
    Created on : Oct 16, 2011, 5:11:10 PM
    Author     : VIC
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="Beans.*,java.util.*,java.text.*,Models.*"%>
<!--
Kiểm tra user vào trang này có quyền quản trị viên không ?
-->
<%
            NhanVien nv = new NhanVien();
            if (session.getAttribute("nv") == null) {
                response.sendRedirect("../index.jsp");
                return;
            } else {
                nv = (NhanVien) session.getAttribute("nv");
                if (nv == null || nv.getMaNNV() != 1) {
                    response.sendRedirect("../index.jsp");
                    return;
                }
            }
%>
<!--
   Danh sách các tham số hệ thống ở trang này :
   area signout
-->
<html>
    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>i-Order</title>
        <link rel="icon" href="../images/icon.png" />
        <link rel="shortcut icon" href="../images/icon.png" />
        <link rel="apple-touch-icon" href="../images/icon.png"/>
        <link rel="apple-touch-icon-precomposed" href="../images/icon.png"/>
        <link href="../css/style.css" type="text/css" rel="stylesheet" />
        <link href="../css/ui-darkness/jquery-ui-1.8.16.custom.css" type="text/css" rel="stylesheet" />
        <link href="../css/jquery.alerts.css" type="text/css" rel="stylesheet" />
        <script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
        <script src="../js/jquery.ui.datepicker-vi.js" type="text/javascript"></script>
        <script src="../js/jquery.ui.datepicker-fr.js" type="text/javascript"></script>
        <script src="../js/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>        
        <script src="../js/jquery.alerts.js" type="text/javascript"></script>
        <script src="../js/msg.js" type="text/javascript"></script>
        <script src="../js/ajax.js" type="text/javascript"></script>
        <script src="../js/highcharts.js" type="text/javascript"></script>
        <script src="../js/themes/gray.js" type="text/javascript"></script>
        <script src="../js/chart.js" type="text/javascript"></script>
        <title>JSP Page</title>
        <script type="text/javascript">
            $().ready(function() {
                $('a.toggle').click(function(){
                    
                });        
                $('dd:not(:first)').hide();
                $('dt a').click(function(){
                    $('dd:visible').slideUp('slow');
                    $('dt.current').removeClass('current');
                    $(this).parent().addClass('current');
                    if($(this).parent().next().is(':hidden')==true){
                        $(this).parent().addClass('current').next().slideDown('slow');
                    }        
                });
                $('#sidebar ul li a').click(function(){
                    $('#sidebar li.current').removeClass('current');
                    $(this).parent().addClass('current');
                });
                DrawChart(); 
            });
        </script>        
    </head>
    <%
                int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
                String dsts = " 'chartturnover', 'msgdetailuser', 'msgpass', 'newpass', 'checksubmitmsg', 'save', 'phonenumber', 'address', 'nameofuser', 'utilities', 'hello', 'account', 'company', 'home', 'bill', 'statistics', 'historyprice', 'servicecharge', 'time', 'customer', 'customertype', 'option', 'area', 'promotion', 'notice', 'food', 'rightmsg', 'currency', 'unit', 'signout', 'table', 'historysystem', 'user', 'foodgroups' "; // chuỗi chứa các mã tham số của trang này.
                ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.
                String account = mdsts[0].getTenTS();
                String address = mdsts[1].getTenTS();
                String area = mdsts[2].getTenTS();
                String bill = mdsts[3].getTenTS();
                String chartturnover = mdsts[4].getTenTS();
                String checksubmitmsg = mdsts[5].getTenTS();
                String company = mdsts[6].getTenTS();
                String currency = mdsts[7].getTenTS();
                String customer = mdsts[8].getTenTS();
                String customertype = mdsts[9].getTenTS();
                String food = mdsts[10].getTenTS();
                String foodgroups = mdsts[11].getTenTS();
                String hello = mdsts[12].getTenTS();
                String historyprice = mdsts[13].getTenTS();
                String historysystem = mdsts[14].getTenTS();
                String home = mdsts[15].getTenTS();
                String msgdetailuser = mdsts[16].getTenTS();
                String msgpass = mdsts[17].getTenTS();
                String nameofuser = mdsts[18].getTenTS();
                String newpass = mdsts[19].getTenTS();
                String notice = mdsts[20].getTenTS();
                String option = mdsts[21].getTenTS();
                String phonenumber = mdsts[22].getTenTS();
                String promotion = mdsts[23].getTenTS();
                String rightmsg = mdsts[24].getTenTS();
                String save = mdsts[25].getTenTS();
                String servicecharge = mdsts[26].getTenTS();
                String signout = mdsts[27].getTenTS();
                String statistics = mdsts[28].getTenTS();
                String table = mdsts[29].getTenTS();
                String time = mdsts[30].getTenTS();
                String unit = mdsts[31].getTenTS();
                String utilities = mdsts[33].getTenTS();
                String user = mdsts[32].getTenTS();
                String msgright = notice + "/" + rightmsg;
                String msgchecksubmit = notice + "/" + checksubmitmsg;
                String passmsg = notice + "/" + msgpass;
                String detailusermsg = notice + "/" + msgdetailuser;
                Calendar cal = Calendar.getInstance();
                SimpleDateFormat fm = new SimpleDateFormat("yyyy");
                String year = fm.format(cal.getTime());
    %>
    <body>        
        <div id="head">
            <div class="left">
                <a class="button profile" href="">
                    <img style=" margin-top: 4px;" alt="" src="../images/huser.png">
                </a>
                <div style=" float: left; width: 50px;"><%=hello%></div>
                <div id="tendangnhap" style=" float: left;"><%=nv.getHoTen()%></div>
            </div>
            <div class="userNav">
                <ul>
                    <li>
                        <a href="#" onclick="ShowChangePass()">
                            <img alt="" src="../images/settings.png"><span><%=account%></span>
                        </a>
                        <div id="changepass" style="width: 355px; margin-top: 41px; margin-left: -130px !important; background: url('../images/topNav.jpg') repeat; ">
                            <form action="" id="changepasss">
                                <div style=" margin: 10px 10px 8px;">
                                    <div style=" width: 120px; float: left; font-size: 13px; padding-left: 5px;"><%=nameofuser%></div>
                                    <input style=" width: 200px; margin-top: 8px;" type="text" class="text tennv" name="tennv" value="<%=NhanVien_Model.LayTenNV(nv.getMaNV())%>" >
                                </div>
                                <div style=" margin: 10px 10px 8px; clear: both;">
                                    <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=newpass%></div>
                                    <input style=" width: 200px; margin-top: 8px;" type="text" class="text newpass" name="newpass" >
                                </div>
                                <div style=" margin: 10px 10px 8px; clear: both;">
                                    <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=address%></div>
                                    <input style=" width: 200px; margin-top: 8px;" type="text" class="text diachi" name="diachi" value="<%=NhanVien_Model.LayDiaChi(nv.getMaNV())%>">
                                </div>
                                <div style=" margin: 10px 10px 8px; clear: both;">
                                    <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=phonenumber%></div>
                                    <input style=" width: 200px; margin-top: 8px;" type="text" class="text sodt" name="sodt" onkeypress="return keypress(event)" value="<%=NhanVien_Model.LaySoDT(nv.getMaNV())%> " >
                                </div>
                                <div class="cb"></div>
                                <input style=" margin-left: 135px; margin-bottom: 10px; margin-top: 10px;" class="button" type="button"  value="<%=save%>" lang="<%=passmsg%>" alt="<%=msgchecksubmit%>" id="<%=detailusermsg%>" onclick="Changepass(this.lang, this.alt, this.id)">
                            </form>
                        </div>
                    </li>
                    <li>
                        <a href="../DangNhap_Controller?action=logout">
                            <img alt="" src="../images/lgout.png"><span><%=signout%></span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="sidebar">
            <dl>                
                <dt class="current home"><a href="../admin/admin.jsp"><span><%=utilities%></span></a></dt>
                <dt class="area"><a href="#" class="1" name="<%=msgright%>" onclick="NewArea(this.className, this.name);"><span><%=area%></span></a></dt>
                <dt class="table"><a href="#" class="1" name="<%=msgright%>" onclick="NewTable( this.className, this.name);"><span><%=table%></span></a></dt>
                <dt class="currency"><a href="#"  class="1" name="<%=msgright%>" onclick="Currency( this.className, this.name);"><span><%=currency%></span></a></dt>
                <dt class="food"><a href="#" class="1" ><span><%=food%></span></a></dt>
                <dd style=" display: none;">
                    <ul>
                        <li>
                            <a href="../MonAn_Controller?action=Show&item=1"><%=food%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="Foodgroups( this.className, this.name);"><%=foodgroups%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="Unit( this.className, this.name);"><%=unit%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="Option( this.className, this.name);"><%=option%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="HistoryPrice( this.className, this.name);"><%=historyprice%></a>
                        </li>                        
                    </ul>
                </dd>
                <dt class="servicecharge"><a href="#"><span><%=servicecharge%></span></a></dt>
                <dd>
                    <ul>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="ServiceCharge( this.className, this.name);"><%=servicecharge%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="Time( this.className, this.name);"><%=time%></a>
                        </li>
                    </ul>
                </dd>
                <dt class="promotion"><a href="#"  class="1" name="<%=msgright%>" onclick="Promotion( this.className, this.name);"><span><%=promotion%></span></a></dt>
                <dt class="customer"><a href="#"><span><%=customer%></span></a></dt>
                <dd>
                    <ul>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="Customer( this.className, this.name);"><%=customer%></a>
                        </li>
                        <li>
                            <a href="#"  class="1" name="<%=msgright%>" onclick="CustomerType( this.className, this.name);"><%=customertype%></a>
                        </li>                        
                    </ul>
                </dd>
                <dt class="user"><a href="#"  class="1" name="<%=msgright%>" onclick="User( this.className, this.name);"><span><%=user%></span></a></dt>
                <dt class="bill"><a href="#"  class="1" name="<%=msgright%>" onclick="Bill( this.className, this.name);"><span><%=bill%></span></a></dt>
                <dt class="history"><a href="#"  class="1" name="<%=msgright%>" onclick="History( this.className, this.name);"><span><%=historysystem%></span></a></dt>
                <dt class="statics"><a href="#"  class="1" name="<%=msgright%>" onclick="Statistics( this.className, this.name);"><span><%=statistics%></span></a></dt>
                <dt class="company"><a href="#"  name="<%=msgright%>" onclick="Company(this.name);"><span><%=company%></span></a></dt>
            </dl>
        </div>
        <div id="content" class="white">
            <div class="center" style="display: block; margin-top: 35px;">
                <h1><img style="margin-right: 13px; opacity: 0.8; margin-top: 5px;" alt="" src="../images/inbox.png"><%=utilities%></h1>
                <ul id="ulities">
                    <li>
                        <a style=" margin-left: 0px;" class="shortcut last" href="../MonAn_Controller?action=Show&item=1">
                            <img alt="" style="opacity: 0.8; margin-top: 4px; margin-bottom: 10px;" src="../images/food1.png"><br/><%=food%>
                        </a>
                    </li>
                    <li>
                        <a class="shortcut last" href="#" id="1" name="<%=msgright%>" onclick="HistoryPrice(this.id, this.name);">
                            <img alt="" style="opacity: 0.8; margin-top: 4px; margin-bottom: 10px;" src="../images/money1.png"><br/><%=historyprice%>
                        </a>
                    </li>
                    <li>
                        <a class="shortcut last" href="#" id="1" name="<%=msgright%>" onclick="Promotion(this.id, this.name);">
                            <img alt="" style="opacity: 0.8; margin-top: 4px; margin-bottom: 10px;" src="../images/promotion1.png"><br/><%=promotion%>
                        </a>
                    </li>
                    <li>
                        <a class="shortcut last" href="#" id="1" name="<%=msgright%>" onclick="User(this.id, this.name);">
                            <img alt="" style="opacity: 0.8; margin-top: 4px; margin-bottom: 10px;" src="../images/user1.png"><br/><%=user%>
                        </a>
                    </li>
                    <li>
                        <a class="shortcut last" style="" href="#" id="1" name="<%=msgright%>" onclick="History(this.id, this.name);">
                            <img alt="" style="opacity: 0.8; margin-top: 4px; margin-bottom: 10px;" src="../images/diary1.png"><br/><%=historysystem%>
                        </a>
                    </li>
                    <li>
                        <a class="shortcut last" href="#" id="1" name="<%=msgright%>" onclick="Statistics(this.id, this.name);">
                            <img alt="" style="opacity: 0.8; margin-top: 4px; margin-bottom: 7px;" src="../images/statics1.png"><br/><%=statistics%>
                        </a>
                    </li>
                </ul>         
                <div class="cb"></div>
                <div class="bloc" style=" margin-top: 0;">
                    <div class="title">
                        <%=chartturnover%> <%=year%>
                    </div>
                    <div id="container" class="content highcharts-container" style=" padding: 0; height: 410px; min-width: 600px;">
                    </div>
                </div>
            </div>
        </div>        
    </body>
</html>
